<template>
  <div class="container">
    <el-card shadow="always">
      <el-row :gutter="20" v-if="query.classification != '3'">
        <el-col :span="6">
          <el-date-picker
            v-model="query.month"
            :clearable="clearable"
            :picker-options="pickerOptions"
            type="month"
            placeholder="选择月份"
            value-format="yyyy-MM"
          >
          </el-date-picker>
        </el-col>
        <el-col :span="4">
          <el-select
            v-model="query.taskStatus"
            placeholder="请选择任务状态"
            clearable
          >
            <el-option
              v-for="item in [
                {
                  label: '未完成',
                  value: '0',
                },
                {
                  label: '已完成',
                  value: '1',
                },
              ]"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-col>
        <el-col :span="2">
          <el-button
            type="primary"
            @click="
              query.pageIndex = 1;
              getList();
            "
            >搜索</el-button
          >
        </el-col>
      </el-row>
      <rz-height></rz-height>
      <template v-if="query.classification == '1'">
        <el-table :data="tableData" stripe border style="width: 100%">
          <el-table-column prop="taskDate" label="报告日期"> </el-table-column>
          <el-table-column prop="reportUserName" label="报告人">
            <template slot-scope="scope">
              <div>
                {{ scope.row.reportUserName || "--" }}
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="fillingName" label="填报人">
            <template slot-scope="scope">
              <div>
                {{ scope.row.fillingName || "--" }}
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="morningInspection" label="未检查原因">
            <template slot-scope="scope">
              <div v-if="scope.row.taskStatus != 1">
                <div v-if="scope.row.completeExplain">
                  {{ scope.row.completeExplain }}
                </div>
                <div v-else class="red">未检查</div>
              </div>
              <div v-else>--</div>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="操作">
            <template slot-scope="scope">
              <div>
                <el-button
                  v-if="scope.row.taskStatus == 1"
                  size="mini"
                  type="primary"
                  @click="onView(scope.row)"
                  >查看</el-button
                >
              </div>
            </template>
          </el-table-column>
        </el-table>
      </template>
      <template v-else-if="query.classification == '2'">
        <el-table :data="tableData" stripe border style="width: 100%">
          <el-table-column prop="taskDate" label="日期">
            <template slot-scope="scope">
              {{ scope.row.taskName }}
            </template>
          </el-table-column>

          <el-table-column label="排查日期">
            <template slot-scope="scope">
              <div>
                {{ scope.row.reportDateTime || "--" }}
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="fillingName" label="报告人">
            <template slot-scope="scope">
              <div>
                {{ scope.row.fillingName || "--" }}
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="morningInspection" label="未检查原因">
            <template slot-scope="scope">
              <div v-if="scope.row.taskStatus != 1">
                <div v-if="scope.row.completeExplain">
                  {{ scope.row.completeExplain }}
                </div>
                <div v-else class="red">暂未自查</div>
              </div>
              <div v-else>--</div>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="操作">
            <template slot-scope="scope">
              <div>
                <el-button
                  v-if="scope.row.taskStatus == 1"
                  size="mini"
                  type="primary"
                  @click="onWeekView(scope.row)"
                  >查看</el-button
                >
              </div>
            </template>
          </el-table-column>
        </el-table>
      </template>
      <template v-else-if="query.classification == '3'">
        <el-table
          :data="tableData"
          stripe
          border
          style="width: 100%"
          v-if="query.classification == '3'"
        >
          <el-table-column prop="taskDate" label="日期">
            <template slot-scope="scope">
              {{ scope.row.year }}
              {{ scope.row.taskName }}调度
            </template>
          </el-table-column>
          <el-table-column prop="reportName" label="会议名称">
            <template slot-scope="scope">
              {{ scope.row.reportName || "--" }}
            </template>
          </el-table-column>
          <el-table-column prop="fillingName" label="填报人">
            <template slot-scope="scope">
              {{ scope.row.fillingName || "--" }}
            </template></el-table-column
          >
          <el-table-column prop="morningInspection" label="未自查原因">
            <template slot-scope="scope">
              <div v-if="scope.row.taskStatus != 1">
                <div v-if="scope.row.completeExplain">
                  {{ scope.row.completeExplain }}
                </div>
                <div v-else class="red">暂未检查</div>
              </div>
              <div v-else>--</div>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="操作">
            <template slot-scope="scope">
              <div>
                <el-button
                    v-if="scope.row.taskStatus == 1"
                    size="mini"
                    type="primary"
                    @click="onMonthView(scope.row)"
                    >查看</el-button
                  >
              </div>
            </template>
          </el-table-column>
        </el-table>
      </template>
      <pagination
        :total="total"
        @pagination="getList"
        :page.sync="query.pageIndex"
      />
    </el-card>
    <!-- 针对性自查查看 -->
    <!-- <rz-dialog
      :dialogVisible.sync="dialogVisible"
      :isShowConfirm="false"
      title="查看针对性自查"
       append-to-body
    > -->
    <el-dialog
      title="查看"
      :visible="dialogVisible"
      width="70%"
      append-to-body
      :before-close="
        () => {
          dialogVisible = false;
        }
      "
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      destroy-on-close
    >
      <!-- <el-form label-width="160px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="标题">
              {{ data.checkdatetime }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检查日期">
              {{ data.checkusername }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="检查人">
              {{ data.checkusername }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="自查内容(存在的问题)">
              {{ data.checkcontent }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="问题成因">
              {{ data.causeproblem }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="整改措施">
              {{ data.correctivemeasures }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-form-item label="复查结果">
          {{ data.checkresult }}
        </el-form-item>
        <el-form-item label="整改照片">
          <el-image
            v-for="item in data.list"
            :key="item.id"
            style="width: 150px; height: 150px; margin-right: 10px"
            :src="item.fileUrl"
            fit="fill"
            :preview-src-list="data.list.map((x) => x.fileUrl)"
          ></el-image>
        </el-form-item>
      </el-form> -->

      <el-form ref="form" :model="data" label-width="130px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="报告名称">
              {{ data.reportName }}
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="报告人">
              {{ data.reportUserName }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="报告日期">
              {{ data.reportDateTimeStr }}
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="填报人">
              {{ data.fillingName }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="检查项说明">
              {{ data.remark || "--" }}
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>

      <el-table
        :span-method="objectSpanMethod"
        :data="list"
        border
        style="width: 100%"
        :row-class-name="tableRowClassName"
      >
        <el-table-column prop="label" label="检查内容" width="140">
        </el-table-column>
        <el-table-column prop="labelItem" label="检查项目"> </el-table-column>
        <el-table-column prop="amount2" label="结果" width="100">
          <template slot-scope="scope">
<span v-if="scope.row.radio=='是'" class="green">{{scope.row.radio}}</span>
          <span v-else-if="scope.row.radio=='否'" class="red">{{scope.row.radio}}</span>
          <span v-else style="color:#E6A23C">{{scope.row.radio}}</span>
            <span v-if="scope.row.rectification == 2">(未整改)</span>
            <span
              v-else-if="scope.row.rectification == 3"
              style="
                text-decoration: underline;
                cursor: pointer;
                color: #1890ff;
              "
              @click="risk(scope.row.controlContentId)"
              >(已整改)</span
            >
          </template></el-table-column
        >
        <el-table-column prop="amount2" label="不符合项说明" width="200">
          <template slot-scope="scope" v-if="scope.row.radio == '否'">
            <div>不符合项说明:{{ scope.row.contentRemark }}</div>
            <rz-height></rz-height>

            <upload disabled v-model="scope.row.pictureList" />
          </template>
        </el-table-column>
      </el-table>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
      </div>
    </el-dialog>

    <el-dialog
      title="查看整改风险项"
      :visible="dialogRisk"
      width="50%"
      append-to-body
      :before-close="
        () => {
          dialogRisk = false;
        }
      "
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      destroy-on-close
    >
      <el-form ref="form" :model="riskDat" label-width="130px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="填报人">
              {{ riskDat.fillingName }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="负责人">
              {{ riskDat.rectificationName }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="不符合项目">
              {{ riskDat.checkItemName }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="不符合项目内容">
              {{ riskDat.itemNo }}、{{ riskDat.itemContent }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="不符合情况描述">
              {{ riskDat.remark }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="整改措施落实情况">
              {{ riskDat.rectificationMeasures }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="整改日期">
              {{ riskDat.rectificationDateStr }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="整改附件">
              <upload disabled v-model="riskDat.pictureList" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>

      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogRisk = false">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 常规性&&全项目自查 -->
    <!-- <rz-dialog
      :dialogVisible.sync="dialogVisibleCheckResult"
      :isShowConfirm="false"
      :title="query.classification == 1 ? '查看常规性自查' : '查看全项目自查'"
    >
      <el-form label-width="120px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="自查日期">
              {{ CheckResult.checkdatetime }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="完成时间">
              {{ CheckResult.completionDate }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="自查人员">
              {{ CheckResult.checkusername }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检查结果情况">
              {{ CheckResult.remark || "--" }}
            </el-form-item>
          </el-col>
        </el-row>
        <div v-for="item in CheckResult.list" :key="item.id" class="list">
          <div class="title">{{ item.checkItemname }}</div>
          <div v-for="items in item.list" :key="items.id" class="item">
            <span> {{ items.itemno }}、 </span>
            <span v-html="items.itemcontent"></span>
            <rz-height></rz-height>
            <div>
              检测结果
              <span v-if="items.checkresult == '合格'" class="green">{{
                items.checkresult
              }}</span>
              <span v-else class="red">{{ items.checkresult }}</span>
            </div>
          </div>
        </div>
      </el-form>
    </rz-dialog> -->

    <!-- <rz-dialog
      :dialogVisible.sync="dialogVisibleWeek"
      :isShowConfirm="false"
      title="查看周排查"
    > -->
    <el-dialog
      title="查看整改风险项"
      :visible="dialogVisibleWeek"
      width="80%"
      append-to-body
      :before-close="
        () => {
          dialogVisibleWeek = false;
        }
      "
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      destroy-on-close
    >
      <el-form ref="form" :model="weekDta" label-width="130px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="报告名称">
              {{ weekDta.reportName }}
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="报告日期" prop="reportDateTime">
              {{ weekDta.reportDateTimeStr }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="报告周期起">
              {{ weekDta.reportStartTimeStr }}
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="报告周期止">
              {{ weekDta.reportEndTimeStr }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="填报人" prop="fillingName">
              {{ weekDta.fillingName }}
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="报告人" prop="reportUserName">
              {{ weekDta.reportUserName }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="情况评价" prop="situationEval">
              {{ weekDta.situationEval }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="下周工作重点" prop="nextWeekFocus">
              {{ weekDta.nextWeekFocus }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="周排查会议附件" prop="weekPictureList">
              <upload v-model="weekDta.weekPictureList" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="本周风险隐患">
              <el-table
                :data="weekDta.weeklyScreeningControlResponseList"
                border
                style="width: 100%"
              >
              
                   <el-table-column prop="reportDateTime" label="报告日期" width="100">
                </el-table-column>
                <el-table-column
                  prop="checkItemName"
                  label="检查项目"
                  width="180"
                >
                </el-table-column>
                <el-table-column prop="itemContent" label="检查内容">
                </el-table-column>
                <el-table-column prop="taskDate" label="检查结果" width="80">
                  <template slot-scope="scope">
                    <div v-if="scope.row.rectification == 1" class="green">
                      已整改
                    </div>
                    <div v-else class="red">未整改</div>
                  </template>
                </el-table-column>
                <el-table-column prop="taskDate" label="操作" width="100">
                  <template slot-scope="scope">
                    <el-button
                      size="mini"
                      type="primary"
                      v-if="scope.row.rectification == 1"
                      @click="seeInspectDay(scope.row)"
                      >查看</el-button
                    >
                  </template>
                </el-table-column>
              </el-table>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </el-dialog>

    <el-dialog
      title="查看整改风险项"
      :visible="dialogView"
      width="50%"
      append-to-body
      :before-close="
        () => {
          dialogView = false;
        }
      "
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      destroy-on-close
    >
      <el-form ref="form" :model="seeData" label-width="150px">
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="负责人">
              {{ seeData.rectificationName }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="整改日期">
              {{ seeData.rectificationDateStr }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="24">
            <el-form-item label="不符合项目内容">
              {{ seeData.itemNo }} {{ seeData.itemContent }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="不符合情况描述">
              {{ seeData.remark }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="整改措施落实情况">
              {{ seeData.rectificationMeasures }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="24">
            <el-form-item label="整改附件" prop="pictureList">
              <upload v-model="seeData.pictureList" disabled />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </el-dialog>








    <el-dialog
      append-to-body
      title="查看月调度"
      :visible="dialogVisibleMonth"
      width="70%"
         :before-close="
        () => {
          dialogVisibleMonth = false;
        }
      "
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      destroy-on-close
    >
      <el-form ref="form" :model="weekDta" label-width="170px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="会议名称">
              {{ weekDta.meetingName }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="报告日期">
              {{ weekDta.meetingDateTimeStr }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="填报人">
              {{ weekDta.fillingName }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="汇报人">
              {{ weekDta.safetyOfficer }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="负责人">
              {{ weekDta.personCharge }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="参会人员">
              {{ weekDta.participants }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="参会地点">
              {{ weekDta.venue }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="安全管理工作情况汇报">
              {{ weekDta.safetyOfficerReport }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="企业主要负责人发言">
              {{ weekDta.personChargeSpeak }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="下月食品安全管理重点工作调度计划">
              {{ weekDta.nextMonthlyFocus }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="月调度会议附件" prop="weekPictureList">
              <upload v-model="weekDta.monthlyPictureList" disabled />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </el-dialog>






  </div>
</template>
<script>
import {
  findDailyControl,
  findByIdDailyControl,
  findControlRectification,
  findWeeklyScreeningResult,
  findMonthlyScreeningResult
} from "@/api/modules/enterprise";

export default {
  // props:[],
  props: {
    classification: {
      type: String,
      default: "1",
    },
    unId: {
      type: String,
    },
    taskStatus: {
      type: String,
      default: "1",
    },
 clearable: {
      type: Boolean,
      default: false,
    },
    
  },
  // 页面加载
  created() {
    this.query.classification = this.classification;
    this.query.unId = this.unId;
    this.query.taskStatus = this.taskStatus;

    this.getList();
    // this.getCompanyMainPageInfo();
  },
  // 页面加载完成
  mounted() {},
  //实例销毁之前
  beforeDestroy() {},
  //实例销毁后
  destroyed() {},
  data() {
    return {
      pickerOptions: {
        disabledDate(time) {
          return (
            time.getTime() > Date.now() ||
            time.getTime() < new Date("2021-01-01").getTime()
          );
        },
      },
      query: {
        // classification: "3",
        // ifOut: "0",
        // month: "",
        // page: 1,
        // pageSize: 10,
        // title: "日管控",
        // unitId:sessionStorage.getItem("interpretation"),
        classification: "1",
        month: "",
        pageIndex: 1,
        pageSize: 10,
        taskStatus: "1",
        unId: "",
      },
      //   query: {
      //     classification: "1",
      //     ifOut: "",
      //     isPage: 0,
      //     month: "",
      //     page: 1,
      //     pageSize: 10,
      //     title: 1,
      //     taskState: "-1",
      //     unitId: sessionStorage.getItem("interpretation"),
      //     year: `${new Date().getFullYear()}`,
      //   },
      riskDat: {},
      tableData: [],
      total: 0,
      dialogVisible: false,
      dialogRisk: false,
      dialogVisibleWeek: false,
      weekDta: {},
      seeData: {},
      dialogView: false,
      list: [],
      data: {},
      dialogVisibleMonth:false,
    };
  },
  // 方法
  methods: {
    getList() {
      findDailyControl(this.query).then((res) => {
        this.tableData = res.data.list;
        this.total = res.totalCount;
      });
    },
    async onView(e) {
      let { data } = await findByIdDailyControl({
        id: e.id,
        state: "1",
      });
      this.list = [];
      data.dailyControlMainTableResponseList.forEach((x) => {
        x.dailyControlControlResponseList.forEach((z) => {
          this.list.push({
            label: x.checkItemName,
            labelItem: z.itemNo + "、" + z.itemContent,
            radio: z.checkResult,
            rectification: z.rectification,
            controlContentId: z.controlContentId,
            pictureList: z.pictureList.map((x) => {
              return {
                url: x.fileUrl,
              };
            }),
            contentRemark: z.checkItemContentId,
          });
        });
      });

      this.data = data;

      this.dialogVisible = true;
      //   if (this.query.classification == 1 || this.query.classification == 2) {
      //     //
      //     findUnitCheckResultInfoById({
      //       id: e.id,
      //     }).then((res) => {
      //       this.dialogVisibleCheckResult = true;
      //       this.CheckResult = res.data;
      //     });
      //   } else if (this.query.classification == 3) {
      //     this.PertinenceInspect = e;
      //     this.dialogVisible = true;
      //   }
    },
    async seeInspectDay(e) {
      let { data } = await findControlRectification({
        id: e.controlContentId,
      });
      data.pictureList.forEach((x) => {
        x.url = x.fileUrl;
      });
      this.seeData = data;
      this.dialogView = true;
    },
    async onWeekView(e) {
      console.log(e);
      // this.weekDta=e;
      let { data } = await findWeeklyScreeningResult({
        id: e.id,
      });
      console.log(data);
      data.weekPictureList = data.weekPictureList.map((x) => {
        return {
          url: x,
        };
      });
      this.dialogVisibleWeek = true;
      this.weekDta = data;
    },
    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
      if (columnIndex === 0) {
        if (
          rowIndex == 0 ||
          rowIndex == 15 ||
          rowIndex == 26 ||
          rowIndex == 35 ||
          rowIndex == 38
        ) {
          return {
            rowspan: 3,
            colspan: 1,
          };
        } else if (
          rowIndex == 3 ||
          rowIndex == 18 ||
          rowIndex == 41 ||
          rowIndex == 43 ||
          rowIndex == 45 ||
          rowIndex == 47 ||
          rowIndex == 57
        ) {
          return {
            rowspan: 2,
            colspan: 1,
          };
        } else if (rowIndex == 5) {
          return {
            rowspan: 5,
            colspan: 1,
          };
        } else if (rowIndex == 10) {
          return {
            rowspan: 1,
            colspan: 1,
          };
        } else if (rowIndex == 11 || rowIndex == 49 || rowIndex == 53) {
          return {
            rowspan: 4,
            colspan: 1,
          };
        } else if (rowIndex == 20 || rowIndex == 29) {
          return {
            rowspan: 6,
            colspan: 1,
          };
        } else {
          return {
            rowspan: 0,
            colspan: 0,
          };
        }
      }
    },
    tableRowClassName({ row, rowIndex }) {
      if (row.radio == "否") {
        return "red";
      }
      return "";
    },
    async risk(id) {
      let { data } = await findControlRectification({ id });
      data.pictureList.forEach((x) => {
        x.url = x.fileUrl;
      });
      this.riskDat = data;

      this.dialogRisk = true;
    },
      async onMonthView(e) {
      let { data } = await findMonthlyScreeningResult({
        id: e.id,
      });
      data.monthlyPictureList = data.monthlyPictureList.map((x) => {
        return {
          url: x,
        };
      });
      this.dialogVisibleMonth = true;
      this.weekDta = data;
    },
  },
  // 监听属性
  watch: {
    "query.classification": {
      immediate: true,
      handler(newValue) {
        if (newValue == 3) {
          this.query.month = "";
        }else if(this.clearable){
  this.query.month =""
        } else {
          this.query.month =
            new Date().getFullYear() + "-" + (new Date().getMonth() + 1).toString().padStart(2,'0');;
        }
      },
    },
  },
  // 组件
  components: {
    upload: () => import("@/views/enterprise/components/upload"),
  },
  // 计算属性
  computed: {},
};
</script>

<style lang="scss" scoped>
.container {
  .el-button {
    margin: 0 10px;
  }
  .list {
    padding: 10px;
    .item {
      padding: 10px 30px;
    }
    .title {
      font-weight: 600;
      font-size: 14px;
    }
  }
  .green {
    color: #008000;
  }
  .red {
    color: #ff0000;
  }
  a {
    text-decoration: underline;
    color: $default;
  }
}
</style>